Refactor: decouple core libraries from the default task set and make judo reusable as a third-party library - #121
Open
dta-bdai wants to merge 1 commit into
Open
Conversation
dta-bdai
requested review from
alberthli,
bhung-bdai,
jbruedigam-bdai,
pculbertson and
slecleach
as code owners
August 25, 2026 19:26
dta-bdai
force-pushed
the
dta/refactor
branch
2 times, most recently
from
August 25, 2026 20:17
13c2bb7 to
67810a2
Compare
bhung-bdai
reviewed
Sep 1, 2026
bhung-bdai
left a comment
Collaborator
There was a problem hiding this comment.
The elite gold colored trace seems to have disappeared. Do you know what happened to it?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR restructures judo so its core libraries (tasks, optimizers, controllers,
simulation) are decoupled from judo's default task set and its dora application.
The goal is to let third-party packages reuse judo's mechanisms — the registries,
the
Controller, the simulation/rollout backends — while registering their owntasks, policies, and backends, without inheriting judo's batteries-included
defaults or being forced to build judo's C++ extension.
No behavior changes for the standard judo app; this is primarily a structural /
API refactor plus a set of shutdown-robustness fixes.
Key changes
Registry / application split
judo.appis now the batteries-included default task set. Importing it(or calling
register_default_tasks()) registers judo's built-in tasks anddeclares how each is wired (rollout backend, simulation backend, locomotion
policy). The individual libraries no longer auto-populate the registry, so
third parties can register their own tasks instead of, or in addition to, the
defaults (re-registering a name overrides it).
judo.registrationmodule withregister_tasks_from_cfg,register_optimizers_from_cfg, andget_class_from_stringfor config-drivenregistration.
Registry-aware controller factory
judo.controller.factory.make_controller. TheControllerclass isnow decoupled from the registries — it receives its backend and locomotion
policy explicitly.
make_controllerreads the registries to resolve thosevalues and constructs the controller, so it depends only on the registry
mechanism, not on any particular set of registered tasks.
(and its C++ extension) is only imported when a backend is actually
instantiated.
locomotion_policy_pathfrom the registry is threaded to thebackend via
rollout_backend_kwargs["policy_path"].Module reorganization
judo/mujoco_extensions/(from the top-levelmujoco_extensions/) so it ships inside the package.judo/app/structs.py→judo/structs.py.controller.py→controller_node.py,simulation.py→simulation_node.py,visualization.py→visualization_node.py.*_simulation.py→hierarchical_mj_simulation.py,*_rollout_backend.py→hierarchical_mj_rollout_backend.py.Shutdown robustness (Ctrl-C)
remove their children), fixing the
GuiTabHandlewarning on teardown._runningflag and a_send_outputwrapper thatstops cleanly when the dora event stream closes mid-step.
main_appnow catchesKeyboardInterrupt/SystemExit/subprocess.CalledProcessErrorand runs a single forced cleanup.Testing
pixi run -e dev python -m pytest tests -q— all tests pass.pixi run -e dev ruff check judo run_mpc tests— clean.pixi run build— C++ extension builds; wheel packages the.sowith thecorrect RPATH.
Notes for downstream consumers
judo.appand instead call
judo.tasks.register_task(orjudo.registration.register_tasks_from_cfg) directly.locomotion_policy_pathwill nowreceive a
policy_pathkwarg — backend constructors should accept it.